doctype html
include head.jade
html(ng-app="ngAnimate")
	head
		mixin head("教室管理系统")
	body(ng-controller='mainCtrl')
		include index-nav.jade
		ul#loader
			li
			li
			li
			li
			li
			li
			li
			li
		.container.ng-cloak#controller(,style="display:none")
			.row
				//- 左边栏
				.col-md-2.class-ul
					ul.nav.bs-sidenav.bs-sidebar
						li(ng-repeat='lou in jiaoxuelou', ng-click='setlouNow(lou)')
							a {{lou.name}}
				//- 右边主体部分
				.col-md-7
					h3 当前教学楼:{{louNow.name}} 快速过滤:
						input(type='text', name='', value='', ng-model='louFilter')
					div#table-animate
						table.table.table-bordered.table-hover#state-table
							//- 表头
							tr
								td 教学楼
								-for item in ['01','02','03','04','05','06','07','08','09','10']
									td=item
								
							tr.animate-repeat(ng-repeat='js in jiaoshi|filter:{jiaoxuelou_id:louNow.id}:true|filter:find')
								td {{js.jiaoshi_name}}
								td(ng-repeat='i in [1,2,3,4,5,6,7,8,9,10]', ng-click='clickTd(js.jiaoshi_id,i)') {{showTd(js,$index)}}
				.col-md-3
					//- 登录框
					//- #userinf
					//- 	div(ng-show='login.isLogin')
					//- 		h3
					//- 			| {{login.username}}({{login.nickname}})
					//- 			span(ng-click='logout()') 点击注销
					//- 	div(ng-show='!login.isLogin', ng-click='loginPost()')
					//- 		h3 你还没有登录
					#sandbox-container
						input#toDay(type='text', value='{{toDay|date:\'yyyy-MM-dd\'}}', readonly='')
						//- div供日历控件使用
						div.box
			//- debug栏
			.row
				hr 
				//- *****************************************debug*****************************************
				h2.ding-foot(ng-init='debug=false', ng-click='debug=!debug') Debug
				div(ng-if='debug')
					| State:
					pre.
						\n{{State|json}}          
					//
						StateArray:{{StateArray}}
					br
					| louFilter:{{louFilter}}
					br
					| louNow:{{louNow}}
					br
					| toDay:{{toDay|date:'yyyy-MM-dd HH:mm:ss'}}
					br
					| jiaoshi:{{jiaoshi}}
					hr
					| jiaoxuelou:
					pre.
						\n{{jiaoxuelou|json}}}          

			#other.row
				//- 新增信息框
				#lookup-modal.modal
					.modal-dialog
						.modal-content
							.modal-header
								button.close(type='button', data-dismiss='modal', aria-hidden='true') ×
								h4.modal-title {{modalLookupTitle}}(绿色部分点击可编辑)
								table.table.table-bordered.table-hover
									tr
										td 日期:
										td {{toDay|date:'yyyy-MM-dd'}}
									tr
										td 时间:
										td 第{{"零一二三四五六七八九十"[lookupModal.occupy]}}节课
									tr
										td 教室:
										td {{lookupModal.jiaoshi_name}}
									tr
										td 预订人:
										td {{lookupModal.username}}({{lookupModal.usernick}})
									tr
										td 简单描述(6字以内):
										td.success(contenteditable='contenteditable')
											input(type='', name='', value='', ng-model='lookupModal.tips')
									tr
										td 具体描述:
										td.success(contenteditable='contenteditable')
											input(type='', name='', value='', ng-model='lookupModal.the_usage')
							.modal-footer(style='text-align: center; margin-top: 0px;')
								span#msgbox.alert.alert-danger(style='opacity: 1; padding: 9px;', ng-show='lookupModal.msg.length') {{lookupModal.msg}}
								button.btn.btn-primary(type='button', data-dismiss='modal') 关闭
								button.btn.btn-success(type='button', ng-click='save(\'save\')') 保存
								button.btn.btn-danger(type='button', ng-click='save(\'del\')') 删除
				//- 登陆框	
				#modal-login.modal(ng-keyup='modalLoginKey($event)')
					.modal-dialog
						.modal-content
							.modal-header
								button.close(type='button', data-dismiss='modal', aria-hidden='true') ×
								h4.modal-title 登录
							.row
								.col-md-offset-3(style='margin-top: 27px;')
									form.form-horizontal(role='form')
										.form-group
											label.col-sm-2.control-label(for='inputEmail3') 用户名:
											.col-sm-6
												input#inputEmail3.form-control(type='text', ng-model='username', placeholder='学号')
										.form-group
											label.col-sm-2.control-label(for='inputPassword3') 密码:
											.col-sm-6
												input#inputPassword3.form-control(type='password', ng-model='password', placeholder='密码')
							.modal-footer
								span#msgbox.alert.alert-danger(style='opacity: 1; padding: 9px;', ng-show='loginMsg.length') {{loginMsg}}
								button.btn.btn-default.btn-lg(type='button', data-dismiss='modal')
									| 关闭
								button.btn.btn-primary.btn-lg(type='button', ng-click='loginPost()')
									| 登录
			footer.bs-footer#footer(role='contentinfo')
				.container
					p All Copyright Reserved ©2013-2014 e纯
					p Any bug please contact
						a(href='mailto:hi@hi-hi.cn') hi@hi-hi.cn
		mixin script("教室管理系统")

